v9.6.0 - LabApi 1.1.7 - #91
Conversation
…efix for reducing TPS usage
…ager; improved role listing in Percentages; imported roles now correctly getting reloaded and shown in Percentages
…y,regenerate over time) never applied its maximum
…Added Role and CustomFlag value validators; Some improvements in code; Cleaned up and formatted solution;
- Add CustomRoleExtension with helper methods for custom role - Refactor CustomRole.cs and add new methods - Update CompatibilityManager with whitespace cleanup
…ed KeepInventoryOnEscape module
…ole gets removed; fixed CustomKeycard Placeholders with RpNames;
…; implement InfoTag module for custom info display
… left player; Fixed CustomModule decoder
…ot modified by the plugin
FoxWorn3365
left a comment
There was a problem hiding this comment.
I'll end here my review because it was painful.
Probably because of AI or Rider refactoring but the code is now wayy too unreadable.
The main problems are: an ENORMOUS USE OF "var" (dynamic type) which is really pointless and the only thing it does is making the code not user friendly and unreadable (without an IDE).
The other problem was that sometimes some functions were just
continued on a new
line because they were too
long.
Something like that is painful to read.
result =
"HELLO"
is something that I would dream only in a nightmare.
The others are just some suggestions but I warn you that I've stopped my review at the 77th file (/155 - /Commands/SpawnPoint.cs) because I was just writing the same two-three things over and over.
| if (ev is null) | ||
| return; | ||
|
|
||
| foreach (var handler in ev.GetInvocationList()) |
| inZone = true; | ||
|
|
||
| if (!_wasInEscapeZone) | ||
| PlayerEventHandler.Instance.OnEscaping(new PlayerEscapingEventArgs(_role.Player.ReferenceHub, |
There was a problem hiding this comment.
Please write everything in a single line
| { | ||
| internal class AmnesiaResistance : CustomModule | ||
| { } | ||
| } No newline at end of file |
There was a problem hiding this comment.
Please avoid doing
{
}
instead, opt for
{ }
| public override bool Validate(out string error) | ||
| { | ||
| public override List<string> RequiredArgs => new() | ||
| var raw = TryGetStringValue("color", string.Empty); |
| var tokens = TokenRegex.Matches(Order).Cast<Match>().Select(m => m.Groups[1].Value).ToList(); | ||
|
|
||
| var unknown = tokens | ||
| .Where(t => !KnownTokens.Contains(t, StringComparer.OrdinalIgnoreCase)) |
There was a problem hiding this comment.
This is the only case when writing on multiple lines is accepted
| } | ||
|
|
||
| response = "Custom roles of every player:"; | ||
| foreach (var Player in Player.ReadyList.Where(p => !p.IsHost)) |
|
|
||
| response = "Custom roles of every player:"; | ||
| foreach (var Player in Player.ReadyList.Where(p => !p.IsHost)) | ||
| if (Player.TryGetSummonedInstance(out var summoned)) |
|
|
||
| if (!int.TryParse(arguments[1], out var id)) | ||
| { | ||
| response = |
| return false; | ||
| } | ||
|
|
||
| var result = string.Empty; |
| private string SpawnPlayer(Tuple<string, Player> rawPlayer, int id, bool sync) | ||
| private static string SpawnPlayer(Tuple<string, Player> rawPlayer, int id, bool sync) | ||
| { | ||
| var player = rawPlayer.Item2; |
FoxWorn3365
left a comment
There was a problem hiding this comment.
I'll end here my review because it was painful.
Probably because of AI or Rider refactoring but the code is now wayy too unreadable.
The main problems are: an ENORMOUS USE OF "var" (dynamic type) which is really pointless and the only thing it does is making the code not user friendly and unreadable (without an IDE).
The other problem was that sometimes some functions were just
continued on a new
line because they were too
long.
Something like that is painful to read.
result =
"HELLO"
is something that I would dream only in a nightmare.
The others are just some suggestions but I warn you that I've stopped my review at the 77th file (/155 - /Commands/SpawnPoint.cs) because I was just writing the same two-three things over and over.
No description provided.